package com.doule.farmerassistant;

import android.app.Application;
import android.util.Log;

/**
 * my app class.
 * @author Happy
 *
 */
public class FarmerassistantApp extends Application {
    @Override
    public void onCreate() {
        setDefaultUncaughtExceptionHandler();
        super.onCreate();
    }
    
    /**
     * no.
     */
    private static void setDefaultUncaughtExceptionHandler() {
        try {
            Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {

                @Override
                public void uncaughtException(Thread t, Throwable e) {
                    e.printStackTrace();
                    try {
                        throw e;
                    } catch (Throwable e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
                }
            });
        } catch (SecurityException e) {
            Log.e("APP", "Could not set the Default Uncaught Exception Handler");
        }
    }
}
